/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.artic.jme3gui.client;

import com.artic.jme3gui.client.loader.AssetItem;
import com.jme3.font.BitmapFont;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author PaulSyntax
 */
public class ApplicationSingelton {

     private static BitmapFont defaultFont;
     private static ApplicationClient client;
     private static List<AssetItem> assetItems = new ArrayList<AssetItem>();

    // Private constructor prevents instantiation from other classes
    private ApplicationSingelton() {
        defaultFont = client.getAssetManager().loadFont("Interface/Fonts/Default.fnt");
    }

    /**
     * SingletonHolder is loaded on the first execution of Singleton.getInstance()
     * or the first access to SingletonHolder.INSTANCE, not before.
     */
    private static class ApplicationSingeltonHolder {
        private static final ApplicationSingelton INSTANCE = new ApplicationSingelton();
    }

    public static ApplicationSingelton getInstance(ApplicationClient client) {
        ApplicationSingelton.client = client;
        return ApplicationSingeltonHolder.INSTANCE;
    }

    public static BitmapFont getDefaultFont() {
        return defaultFont;
    }

    public static List<AssetItem> getAssetItems() {
        return assetItems;
    }

}
